package com.content.Service.Impl.drama;

import com.content.Entity.drama.Audio;
import com.content.Mapper.drama.AudioMapper;
import com.content.Service.drama.AudioService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AudioServiceImpl implements AudioService {
    @Autowired
    private AudioMapper audioMapper;


    @Override
    public void addAudio(Audio audio) {
        audio.setAudioId(makeId());
        audioMapper.addAudio(audio);

    }

    private String makeId() {
        return "DA" + System.currentTimeMillis();
    }

    @Override
    public void updateAudio(Audio audio) {
        audioMapper.updateAudio(audio);
    }

    @Override
    public void deleteAudio(String audioId) {
        audioMapper.deleteAudio(audioId);

    }
}
